﻿/* 
 *  <copyright file="GamepadDevice.cs" company="Wesley Jowitt">
 *  
 *  SobrietyEngine: Copyright (c) 2011 Wesley Jowitt
 *  
 *  This software is distributed under a software license.
 *   * As of the creation time of this file, the license in use is the Microsoft Permissive License (Ms-PL) 
 *    * The license can be viewed at:
 *     * License.Txt in the root folder of this project
 *      * http://sobrietyengine.codeplex.com/license
 *       * http://www.microsoft.com/opensource/licenses.mspx
 *       
 *  </copyright>
 *   */

using System;
using SobrietyEngine.Actor;
using SobrietyEngine.Components;
using SobrietyEngine.Logging;

namespace SobrietyEngine.PathFinding
{
    public class ActorPositionNode: Node
    {
        IPosition actorPositionCmp;
        public IPosition Position { get { return actorPositionCmp; } }

        public IActor Actor { get; private set; }

        public ActorPositionNode():base()
        {
        }

        public ActorPositionNode(IActor linkedActor)
            :base((Object)linkedActor)
        {
            Actor = linkedActor;
            actorPositionCmp = Actor.Get<IPosition>();

            if (Actor == null || actorPositionCmp == null)
                Logger.Error("ActorPositionNode()-> Actor and/or Actor Position Component is null!");
        }
    }
}
